package com.ll19.aop;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.ll19.spring.aop.interfaceTest.IBaseBusiness;

public class AopInterfaceTestCase extends BaseAopTestCase {

	@Autowired
	private IBaseBusiness baseBusiness;

	@Test
	public void testGetUser() throws Exception {
		baseBusiness.delete("猫");
		baseBusiness.add("猫");
		baseBusiness.modify("猫");

		// ☆注意:这里的Bean对象获取必须从代理工厂中去取,否则无法切入
		// 不是上面的baseBusiness
		// 而是代理类businessProxy
		IBaseBusiness bean = (IBaseBusiness) this.applicationContext
				.getBean("businessProxy");

		bean.delete("猫");
		bean.add("猫");
		bean.modify("猫");

	}

}
